unit EPassword;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TfmPassword = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    edPwd: TEdit;
    edConPwd: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure edPwdEnter(Sender: TObject);
    procedure edPwdExit(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmPassword: TfmPassword;

implementation
uses Utility;

{$R *.dfm}

procedure TfmPassword.BitBtn1Click(Sender: TObject);
begin
  if trim(edPwd.text)=trim(edConPwd.text) then
  begin
    ModalResult:=mrOK;
  end else
  begin
    sm('Password entry no match!');
  end;
end;

procedure TfmPassword.edPwdEnter(Sender: TObject);
begin
  SetBackColor(Sender,true);
end;

procedure TfmPassword.edPwdExit(Sender: TObject);
begin
  SetBackColor(Sender,false);
end;

procedure TfmPassword.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#13 then SelectNext(ActiveControl,true,true);
end;

end.
